#ifndef GRIDTASKRESULT
#define GRIDTASKRESULT

/*!
 * \file TaskResult.h
 * \author aimery aviles / thomas raynal
 * \version 2.0
 */

#include <boost\any.hpp>
#include "Utils.h"

/*! \namespace Network
 * 
 * Group master/slave task template & task handling utilities (trees & graphs)
 */
namespace MasterWorkerFramework
{
/*! \class TaskResult
* \brief Represent the product of a slave task execution
*/
class TaskResult
{
public:

	TaskResult(VALUE_TYPE type)
	{
		type_ =type;
	}

	VALUE_TYPE GetType()
	{
		return type_;
	}

	template<class T>
	void SetResult(T* result)
	{
		result_=result;
	}

	template<class T>
	T* GetResult()
	{
		return boost::any_cast<T*>(result_);
	}

private:
	boost::any result_;
	VALUE_TYPE type_;
};
}
#endif